<!--
 * @Description:
 * @Version: 2.0
 * @Autor: huangfu
 * @Date: 2020-09-19 17:31:40
 * @LastEditors: huangfu
 * @LastEditTime: 2020-12-11 15:00:12
-->

<template>
  <div class="qrCode-avatar-dropdown">
    <!-- <Dropdown > -->
      <!-- <Badge :dot="!!messageUnreadCount"> -->
        <!-- <Avatar class="iconfont icon-erweima1"/> -->
        <!-- <i class="iconfont icon-erweima1"></i> -->
      <!-- </Badge> -->
    <!-- </Dropdown> -->
  </div>
</template>
<script>
import './index.less'
import { platformLogout } from '@/libs/login'
export default {
  name: 'User',
  props: {
    userAvatar: {
      type: String,
      default: ''
    },
    messageUnreadCount: {
      type: Number,
      default: 0
    }
  },
  data () {
    return {
      linkUrl: ''
    }
  },
  created () {
    if (process.env.NODE_ENV === 'production') {
      this.linkUrl = 'http://web.zhihuiwenlvyun.com'
    } else if (process.env.NODE_ENV === 'testing') {
      this.linkUrl = 'http://tweb.zhihuiwenlvyun.com'
    } else {
      this.linkUrl = 'http://192.168.1.14:8080/login'
    }
  },
  methods: {
    message () {
      this.$router.push({
        name: 'message_page'
      })
    },
    handleClick (name) {
      switch (name) {
        case 'logout': platformLogout()
          break
        case 'message': this.message()
          break
      }
    }
  }
}
</script>

<style scoped>
.router-item {
  color: #333;
}
.router-link-active .router-item {
  color: #2D8cF0;
}
.icon-erweima {
  color: #fff
}
</style>
